const { contextBridge, ipcRenderer } = require('electron')

console.log('preload be ready')
const capture = async () => {
    const result = await ipcRenderer.invoke('on-capture-event')
    console.log('result>渲染进程发送消息后主进程的返回结果为：',result)
    return result
}
const getConfig = async () => {
    const result = await ipcRenderer.invoke('on-config-event')
    return result
}

contextBridge.exposeInMainWorld('myApi', {
  capture,
  getConfig
})